package com.xuan.core.controller.cul;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xuan.core.configuration.result.ResponseResult;
import com.xuan.core.configuration.result.ResponseResultEnum;
import com.xuan.core.dto.cul.PageDto;
import com.xuan.core.pojo.cul.CulQiMenJi;
import com.xuan.core.service.cul.CulQiMenJiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 奇门吉格Controller
 */
@RestController
@RequestMapping("/culQiMenJi")
public class CulQiMenJiController {

    @Autowired
    private CulQiMenJiService culQiMenJiService; // 奇门吉格Service

//********************************************************************************************************************************

    /**
     * 分页查询
     *
     * @param dto 分页查询数据接收类
     * @return 分页数据
     */
    @PostMapping("/page")
    @Cacheable(value = "culQiMenJiPage", key = "'_' + #dto.page + #dto.pageSize + #dto.queryData")
    public ResponseResult<Page<CulQiMenJi>> page(@RequestBody PageDto dto) {

        Page<CulQiMenJi> page = culQiMenJiService.page(dto);
        return ResponseResult.result(ResponseResultEnum.GET_SUCCESS, page);

    }


}
